<template>
  <div class="page-container">
    <div>
      <h1>404</h1>
      <h1>OOPS！你好像走丢了...</h1>
      <RouterLink
        :to="{ path: backToHomeUrl, replace: true }"
        class="ant-btn ant-btn-primary"
        >回到首页</RouterLink
      >
    </div>
    <img src="@/assets/404.gif" alt="" />
  </div>
</template>

<script lang="ts">
import { useUserStore } from '@/store/modules/user';
import { defineComponent, ref } from 'vue';
export default defineComponent({
  name: 'NotFound',
  setup() {
    const userStore = useUserStore();
    const isExpert = userStore.getRoles[0].id == '4';
    let backToHomeUrl = ref('/');
    isExpert && (backToHomeUrl.value = '/expert_inspect_list');
    return {
      backToHomeUrl,
    };
  },
});
</script>

<style lang="less" scoped>
.page-container {
  display: flex;
  width: 100%;
  height: 100%;
  background-color: white;
  justify-content: center;
  align-items: center;
}
</style>
